/* $RCSFile: IndexRule.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/ADNCRM.RulesEngine/IndexRule.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:30  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Rewrite.NET
{
    /// <summary>
    /// Summary description for IndexRule
    /// </summary>
    public class IndexRule : ConfigurationElement
    {
        [ConfigurationProperty("rule",IsKey=true, IsRequired = true)]
        public string Rule
        {
            get
            {
                return this["rule"] as string;
            }
            set
            {
                this["rule"] =  value;
            }
        }


        [ConfigurationProperty("class", IsRequired = true)]
        public string Class
        {
            get
            {
                return this["class"] as string;
            }
            set
            {
                this["class"] =  value;
            }
        }

        [ConfigurationProperty("assembly", IsRequired = true)]
        public string Assembly
        {
            get
            {
                return this["assembly"] as string;
            }
            set
            {
                this["assembly"] =  value;
            }
        }


        [ConfigurationProperty("breakafter",DefaultValue=(bool)true, IsRequired = false)]
        public bool BreakOnAfter
        {
            get
            {
                return (bool)(this["breakafter"]);
            }
            set
            {
                this["breakafter"] =  value;
            }
        }

        [ConfigurationProperty("breakonfirst",DefaultValue=(bool)true, IsRequired = false)]
        public bool BreakOnFirst
        {
            get
            {
                return (bool)(this["breakonfirst"]);
            }
            set
            {
                this["breakonfirst"] =  value;
            }
        }

        [ConfigurationProperty("handlerflag", IsRequired = false)]
        public string HandlerFlag
        {
            get
            {
                return this["handlerflag"] as string;
            }
            set
            {
                this["handlerflag"] =  value;
            }        
        }
        
        [ConfigurationProperty("handlersplitter", IsRequired = false)]
        public string HandlerSplitter
        {
            get
            {
                return this["handlersplitter"] as string;
            }
            set
            {
                this["handlersplitter"] =  value;
            }        
        }

        [ConfigurationProperty("pageidnosplitter", DefaultValue=(bool)false, IsRequired = false)]
        public bool PageIdNoSplitter
        {
            get
            {
                return (bool)(this["pageidnosplitter"]);
            }
            set
            {
                this["pageidnosplitter"] =  value;
            }        
        }

        [ConfigurationProperty("keywordsplitter",DefaultValue=(bool)false, IsRequired = false)]
        public bool KeywordSplitter
        {
            get
            {
                return (bool)(this["keywordsplitter"]);
            }
            set
            {
                this["keywordsplitter"] =  value;
            }        
        }

        [ConfigurationProperty("aliasinurl",DefaultValue=(bool)false, IsRequired = false)]
        public bool AliasInUrl
        {
            get
            {
                return (bool)(this["aliasinurl"]);
            }
            set
            {
                this["aliasinurl"] =  value;
            }        
        }

        [ConfigurationProperty("Parameters")]
        public ParametersCollection Parameters
        {
            get
            {
                return this["Parameters"] as ParametersCollection;
            }
            set
            {
                this["Parameters"] = value;
            }
        }
    }
}